import {$get, $post, $delete, $put, $postParms} from '@/utils/require'
import {UserApi} from "@/views/user/user.api";
export enum EquipmentRepairAddApi{
  list = "/teacher/equipRepair/list",
  add="/teacher/equipRepair/add"
}

export const list = async (body?: any, params?: any) => {
  try {
    console.log("Api-body", body);
    console.log("Api-params", params);

    // 如果params不存在，则创建一个空对象
    if (!params) {
      params = {};
    }

    // 将body中的内容放入params
    Object.assign(params, body);
    return await $postParms(EquipmentRepairAddApi.list, undefined, params);

  } catch (error) {
    console.error(error);
  }
};

export const insert =async (body?:any, params?:any)=>{
  try{
    console.log("Api-body", body);
    console.log("Api-params", params);

    // 如果params不存在，则创建一个空对象
    if (!params) {
      params = {};
    }
    // 将body中的内容放入params
    Object.assign(params, body);
    return await $postParms(EquipmentRepairAddApi.add,undefined, params);
  }catch (error){
    console.error(error)
  }
}
